<div class="clr"></div>
<?php if(isset($data)){ ?>
<div style=" padding:4px; background-color:#FF9; border:2px solid #FC3; margin-bottom:5px; font-size:14px;">
<div style="float:left;">
<h3 style="font-size:20px;"><?php echo isset($data)?getClientName($data->kd_pa):'';?></h3>
<h3 style="font-size:15px;"><?php echo isset($data)?$data->kd_name:'';?></h3>
<h4><?php
	$b = explode("-",$data->kd_bulan);
	echo "Bulan : ".$this->bulan[$b[1]];
	echo ", Tahun : ".$b[0];

?></h4>
</div>
<div  style="float:right; width:100px; margin-top:12px;">
	<a href="<?php echo $own_links;?>" class="btn-simpan" style="padding:10px; text-decoration:none;"> &laquo; Kembali </a>
</div>
<div class="clr"></div>
</div>
<?php } ?>

<?php if(isset($items) && count($items) > 0){ ?>
<div style=" padding:4px; background-color:#FF9; border:2px solid #FC3; margin-bottom:5px; font-size:14px;">
<h2 style="font-size:15px; float:left;">Total Data : <?php echo count($items);?> data</h2>
<?php
	$jumlah = 0;
	foreach($items as $m){
		$jumlah += $m->detail_sub_premi;
	}
?>
<h2 style="font-size:15px; float:right;">Total Premi : <?php echo myNum($jumlah);?></h2>
<div class="clr"></div>
</div>
<div class="clr"></div>
<?php } ?>
<table class="data">
	<tr>
		<th>No</th>  
        <th>Nama</th>
        <th>Alamat</th>
        <th>Tgl Lahir</th>
        <th>Tgl Akad</th>
        <th>Usia</th>
        <th>Periode Pertanggungan</th>
        <th>Jangka Waktu < 65 thn</th>
        <th>Jangka Waktu > 65 thn</th>   
        <th>Premi Usia 40-65</th>   
        <th>Premi Usia 66-75</th> 
        <th>Nilai Kredit</th>      
        <th>Premi</th>
	</tr>
    <?php if(isset($items) && count($items) > 0){
			$no=1;
			foreach($items as $r){
		?>
     		<tr>
            	<td><?php echo $no++;?></td>
                <td><?php echo $r->detail_nama;?></td>
                <td><?php echo $r->detail_alamat;?></td>
                <td><?php echo myDate($r->detail_tgllahir,"d/m/Y",false);?></td>
                <td><?php echo myDate($r->detail_tglakad,"d/m/Y",false);?></td>
                <td align="center"><?php echo $r->detail_usia;?> Thn</td>
                <td align="center"><?php echo $r->detail_periode_tgj;?> Thn</td>
                <td align="center"><?php echo $r->detail_jwp1;?> Thn</td>
                <td  align="center"><?php echo $r->detail_jwp2;?> Thn</td>
                <td><?php echo myNum($r->detail_rate_pu1);?></td>
                <td><?php echo myNum($r->detail_rate_pu2);?></td>
                <td><?php echo myNum($r->detail_nilai_kredit);?></td>
                <td><?php echo myNum($r->detail_sub_premi);?></td>
            </tr>   
    <?php } 
	}
	?>
</table>
